import { getEnv } from '@/constants/EnumEnv';
const to = (route: string) => getEnv().rootPath.replace(/\/$/, "") + "/" + route;

/**
 * 路由枚举
 */
const EnumRouter = {
    to:to,
    get rootRoute(){ return to('')},		        // 根路由
    get login(){ return to("login") },
    get register(){ return to("register") },

    get appRoot(){ return to("app") },

    //-------------------------常用功能模块相关的路由------------------------------
    get demoModuleRoot(){ return to("app/demoModule") },
    get demoAntdTheme(){ return to("app/demoModule/antdTheme") },
    get demoProTableList(){ return to("app/demoModule/proTableList") },
    get demoThreeJs3D(){ return to("app/demoModule/threeJs3D") },
    get demoCesium3D(){ return to("app/demoModule/cesium3D") },
    get demoJsonSchemaForm(){ return to("app/demoModule/demoJsonSchemaForm") },
    get demoJessibuca(){ return to("app/demoModule/demoJessibuca") },
    // get demoImagePreview(){ return to("app/demoModule/demoImagePreview") },

    //-------------------------视频广场相关的路由------------------------------
    get videoPlayground(){ return to("app/videoPlayground") },

    //-------------------------预览图片相关的路由------------------------------
    get imagePreview(){ return to("app/imagePreview") },

    //-------------------------模拟仿真相关的路由------------------------------
    get networkSimulation(){ return to("app/networkSimulation") },


    //-------------------------系统设置相关的路由------------------------------
    get systemSettingRoot(){ return to("app/systemSetting") },
    get userPersonalSetting(){ return to("app/systemSetting/userPersonalSetting") },    // 个人设置
    get account(){ return to("app/systemSetting/account") },    // 账户管理
    get dataDictionary(){ return to("app/systemSetting/dataDictionary") },    // 数据字典
    get user(){ return to("app/systemSetting/user") },
    get role(){ return to("app/systemSetting/role") },
    get organization(){ return to("app/systemSetting/organization") },
    get notice(){ return to("app/systemSetting/notice") },
    get postjob(){return to("app/systemSetting/post")},
    get menu(){ return to("app/systemSetting/menu") },
    get logManage(){ return to("app/systemSetting/log") },
    get operlog(){ return to("app/systemSetting/log/operlog") },
    get loginlog(){ return to("app/systemSetting/log/loginlog") },
};

export default EnumRouter;


/**
 * 无需校验是否登录的路由列表
 */
export const noValidateLoginRoutes = [
    EnumRouter.login,
    EnumRouter.register,
];

/**
 * 无需校验菜单权限的路由列表
 */
export const noValidateMenuPermissions = [
    EnumRouter.rootRoute,
    EnumRouter.appRoot,
    EnumRouter.userPersonalSetting,
    ...noValidateLoginRoutes,
];
